const { defineConfig } = require('@vue/cli-service')
let target;
if(process.env.NODE_ENV == 'production'){
  target = "http://127.0.0.1:6868/"
}else if(process.env.NODE_ENV == 'development'){
  target = "http://127.0.0.1:6868/"
}

module.exports = defineConfig({
  transpileDependencies: true,
  // publicPath: "api",
  devServer:{
    // https: true
    proxy:{
      '^/api':{
        target: target,
        ws: false,
        changeOrigin: true,// 如果接口跨域，需要进行这个参数配置
        pathRewrite: {
            '^/api': '/' 
        }
      }
    }
  },
})
